package com.ruoyi.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class TencentMapConstants {

    public static String KEY = "3GQBZ-7FPKX-ZHI4N-Z56XV-2NR5H-LKB3Z";

    @AllArgsConstructor
    @Getter
    public enum statusEnum {
        SUCCESS(0, "正常"),
        UNAUTHORIZED(110, "请求来源未被授权"),
        //请求有护持信息请检查字符串
        PROTECT_ERROR(306, "请求参数验证失败！"),
        PARAM_ERROR(310, "请求参数信息有误！"),
        //Key格式错误
        KEY_ERROR(311, "请求参数Key格式错误！"),
        NULL(347, "地址信息有误！"),
        ;
        private int errorCode;
        private String errorText;

        public static statusEnum match(int value) {
            for (statusEnum one : statusEnum.values()) {
                if (one.getErrorCode() == value) {
                    return one;
                }
            }
            return statusEnum.PARAM_ERROR;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum ApiEnum {
        COMMON("https://apis.map.qq.com/ws/geocoder/v1/"),
        ;
        private String url;
    }


}
